import { Rental } from "./rental";

export class Customer {
  rentals: Rental[] = [];

  getRenterPoints(): number {
    return this.rentals.reduce((pre, current) => pre + current.calcPoint(), 0)
  }
  getRentalFee(): number {
    return this.rentals.reduce((pre, current) => pre + current.calcFee(), 0)
  }

  addRental(title: string, days: number) {
    this.rentals.push(new Rental(title, days))
  }

}
